﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Data;

namespace Songhay.DataAccess.Tests
{
    using Entity;

    public partial class SQLiteTest
    {
        [DeploymentItem("Chinook.sqlite")]
        [DeploymentItem("EntityFramework.SqlServer.dll")]
        [DeploymentItem("System.Data.SQLite.dll")]
        [DeploymentItem("System.Data.SQLite.EF6.dll")]
        [DeploymentItem("System.Data.SQLite.Linq.dll")]
        [DeploymentItem(@"x86\SQLite.Interop.dll")]
        [TestCategory("Integration")]
        [TestMethod]
        public void ShouldConnectToChinookWithEF()
        {
            AppDomain.CurrentDomain.SetData("DataDirectory", this.TestContext.DeploymentDirectory);

            using(var context = new ChinookDbContext())
            {
                context.Database.Connection.Open();
                Assert.AreEqual(ConnectionState.Open, context.Database.Connection.State);
            }

        }
    }
}
